package com.googlecode.transmutant.spring

import org.springframework.beans.factory.FactoryBean;

import java.util.List;

public class StepsFactoryBean implements FactoryBean<StepsWrapper> {

   StepsWrapper stepsWrapper
   List<StepWrapper> stepWrappers

   public StepsWrapper getObject() throws Exception {
	  if (this.stepWrappers != null && this.stepWrappers.size() > 0) {
		 for (StepWrapper child : stepWrappers) {
			this.stepsWrapper.steps.add(child)
		 }
	  }
	  return this.stepsWrapper;
   }

   public Class<StepsWrapper> getObjectType() {
	  return StepsWrapper.class;
   }

   public boolean isSingleton() {
	  return true;
   }
}